package com.example.mapper;

import com.example.annotation.PublicAutoFill;
import com.example.enumeration.OperationType;
import com.pojo.entity.DishFlavor;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DishFlavorMapper {


    @Insert("insert into dish_flavor(dish_id,name,value)" +
            " value(#{dishId},#{name},#{value})")
    void save(DishFlavor flavor);

    void deleteArr(@Param("ids") Long[] ids);

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getFlavorListByDishId(@Param("id") Long id);


    void update(DishFlavor dishFlavor);

    @Select("select * from dish_flavor where id = #{id}")
    DishFlavor getDishFlavorById(@Param("id") Long id);

    @Delete("delete from dish_flavor where id = #{id}")
    void deleteById(@Param("id") Long id);
}
